package com.atguigu.demo.service.impl;

import com.alibaba.fastjson.JSON;
import com.atguigu.demo.bean.Customer;
import com.atguigu.demo.mapper.CustomerMapper;
import com.atguigu.demo.service.CustomerService;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@DS("mysql1118")
public class CustomerServiceImpl extends ServiceImpl<CustomerMapper,Customer> implements CustomerService {

    @Autowired
    CustomerMapper customerMapper;


    @DS("mysqll1018")
    public void saveCustomer(Customer customer) {
        System.out.println(" save customer:"+ JSON.toJSONString(customer));
        customerMapper.insertCustomer(customer);

      //  customerMapper.insert(customer);

    }
}
